package model;

/**
 * Player.java
 * Purpose: one who plays the game
 * 
 * @author Hans Brems
 * @version 1.0 01/12/2011
 */

public class Player {
	private String name;
	private String password;
	
	/** Constructs a new player */
	public Player() {
	}
	
	/** Constructs a new player */
	public Player(String name, String password) {
		this.name = name;
		this.password = password;
	}

	/** Returns the name of the player */
	public String getName() {
		return name;
	}

	/** Sets the name of the player */
	public void setName(String name) {
		this.name = name;
	}

	/** Sets the password of the player */
	public void setPassword(String oldPassword, String newPassword) {
		if (this.verifyPassword(oldPassword)) {
			this.password = newPassword;
		}
	}
	
	/** Verifies the given password */
	public boolean verifyPassword(String password) {
		return this.password.equals(password);
	}
}